1. Field of the Invention
The present invention relates to an oscillator circuit disposed in a semiconductor integrated circuit (referred to below as an IC or semiconductor IC), more particularly to an oscillator circuit that provides an oscillating signal with a predetermined frequency when connected to an external crystal resonator or ceramic resonator.
2. Description of the Related Art
A conventional oscillator circuit of the type described in, for example, Hasshin Kairo no Sekkei to Oyo (Design and Applications of Oscillator Circuits) by Inaba (published by CQ, page 157) is shown in FIG. 5. This oscillator circuit C0, which forms part of a semiconductor IC, comprises external terminals 1 and 2, an internal terminal OUT, an inverter I1, a buffer I2, and an internal feedback resistor Rfi. A resonator X (a crystal resonator or ceramic resonator), a damping resistor Rd, and a pair of capacitors Cg, Cd are connected to the external terminals 1, 2. Driven by the inverter I1, the resonator X oscillates at a predetermined frequency, generating an oscillating signal that is reshaped by the oscillating circuit into a square-wave digital pulse signal and sent from the internal terminal OUT to internal circuitry in the IC.
In the oscillator circuit C0 shown in FIG. 5, the internal feedback resistor Rfi provides a direct-current (DC) bias between external terminals 1 and 2. The resistance value of the feedback resistor is a constant that determines the cutoff frequency of the oscillator circuit; as the resistance value is increased, the cutoff frequency becomes lower, enabling the oscillator circuit to oscillate down to a lower frequency. Increasing the resistance value, however, makes the oscillator circuit more susceptible to the effect of current leakage at external terminal 1. If the DC bias varies due to the leakage current, the circuit may oscillate unstably and in the worst case may even fail to oscillate at all. The resistance value of the feedback resistor is therefore preferably optimized according to the required oscillation frequency and the effect of leakage current.
A problem that arises in the above-described conventional oscillator circuit is that it is impossible to measure the small leakage current flowing into external terminal 1 after fabrication because external terminal 1 is connected through the feedback resistor to the output terminal of the inverter I1. Another problem is that the resistance value of the internal feedback resistor Rfi cannot be changed after fabrication.
The present invention addresses these problems, with the object of providing an oscillator circuit that permits leakage current to be measured and the internal resistance value to be changed according to, for example, the measured value of the leakage current.